﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using App_Code;

/// <summary>
/// Summary description for FlushDatabaseCacheController
/// </summary>
public class FlushDatabaseCacheController
{
    List<IFlushDBCache> _list;

	public FlushDatabaseCacheController()
	{
        _list = new List<IFlushDBCache>();
	}

    public void ClearAllCaches() 
    {
        foreach (var flushableThing in _list)
        {
            flushableThing.FlushDBCache();
        }
    }

    internal void Register(IFlushDBCache flushableDatabaseThing)
    {
        _list.Add(flushableDatabaseThing);
    }
}